<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ShopManageRecord extends Model
{
    use HasFactory;
    protected $guarded = [];
    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format('Y/m/d H:i:s');
    }
    //键值
    protected function value(): Attribute
    {
        return new Attribute(
            get: fn ($value) => json_decode($value),
        );
    }
    //键值
    protected function other(): Attribute
    {
        return new Attribute(
            get: fn ($value) => json_decode($value),
        );
    }

}
